import axios from '@/axios';
export const loginApi = {
	// 获取列表
	login: query => {
		return axios({
			url: '/login',
			method: 'post',
			data: query
		});
	}
};
// 管理员管理
export const adminApi = {
	// 获取列表
	getList: query => {
		return axios({
			url: '/admin/list',
			method: 'get',
			params: query
		});
	},
	// 获取列表
	getPage: query => {
		return axios({
			url: '/admin/page',
			method: 'get',
			params: query
		});
	},
	// 增加
	addData: query => {
		return axios({
			url: '/admin/add',
			method: 'post',
			data: query
		});
	},
	// 详情
	detailData: id => {
		return axios({
			url: '/admin/info/' + id,
			method: 'get'
		});
	},
	// 修改
	updateData: query => {
		return axios({
			url: '/admin/update',
			method: 'post',
			data: query
		});
	},
	// 删除
	delData: query => {
		return axios({
			url: '/admin/delete',
			method: 'post',
			data: query
		});
	}
};

// 会员管理
export const userApi = {
	// 获取列表
	getList: query => {
		return axios({
			url: '/user/list',
			method: 'get',
			params: query
		});
	},
	// 获取列表
	getPage: query => {
		return axios({
			url: '/user/page',
			method: 'get',
			params: query
		});
	},
	// 增加
	addData: query => {
		return axios({
			url: '/user/add',
			method: 'post',
			data: query
		});
	},
	// 详情
	detailData: id => {
		return axios({
			url: '/user/info/' + id,
			method: 'get'
		});
	},
	// 修改
	updateData: query => {
		return axios({
			url: '/user/update',
			method: 'post',
			data: query
		});
	},
	// 删除
	delData: query => {
		return axios({
			url: '/user/delete',
			method: 'post',
			data: query
		});
	}
};

// 栏目管理
export const columnApi = {
	// 获取列表
	getList: query => {
		return axios({
			url: '/column/list',
			method: 'get',
			params: query
		});
	},
	// 获取列表
	getPage: query => {
		return axios({
			url: '/column/page',
			method: 'get',
			params: query
		});
	},
	// 增加
	addData: query => {
		return axios({
			url: '/column/add',
			method: 'post',
			data: query
		});
	},
	// 详情
	detailData: id => {
		return axios({
			url: '/column/info/' + id,
			method: 'get'
		});
	},
	// 修改
	updateData: query => {
		return axios({
			url: '/column/update',
			method: 'post',
			data: query
		});
	},
	// 删除
	delData: query => {
		return axios({
			url: '/column/delete',
			method: 'post',
			data: query
		});
	}
};

// 文章管理
export const articleApi = {
	// 获取列表
	getList: query => {
		return axios({
			url: '/article/list',
			method: 'get',
			params: query
		});
	},
	// 获取列表
	getPage: query => {
		return axios({
			url: '/article/page',
			method: 'get',
			params: query
		});
	},
	// 增加
	addData: query => {
		return axios({
			url: '/article/add',
			method: 'post',
			data: query
		});
	},
	// 详情
	detailData: id => {
		return axios({
			url: '/article/info/' + id,
			method: 'get'
		});
	},
	// 修改
	updateData: query => {
		return axios({
			url: '/article/update',
			method: 'post',
			data: query
		});
	},
	// 删除
	delData: query => {
		return axios({
			url: '/article/delete',
			method: 'post',
			data: query
		});
	}
};

// 标签管理
export const tabApi = {
	// 获取列表
	getList: query => {
		return axios({
			url: '/tab/list',
			method: 'get',
			params: query
		});
	},
	// 获取列表
	getPage: query => {
		return axios({
			url: '/tab/page',
			method: 'get',
			params: query
		});
	},
	// 增加
	addData: query => {
		return axios({
			url: '/tab/add',
			method: 'post',
			data: query
		});
	},
	// 详情
	detailData: id => {
		return axios({
			url: '/tab/info/' + id,
			method: 'get'
		});
	},
	// 修改
	updateData: query => {
		return axios({
			url: '/tab/update',
			method: 'post',
			data: query
		});
	},
	// 删除
	delData: query => {
		return axios({
			url: '/tab/delete',
			method: 'post',
			data: query
		});
	}
};

// 标签管理
export const commentApi = {
    // 获取列表
    getList: query => {
        return axios({
            url: '/comment/list',
            method: 'get',
            params: query
        });
    },
    // 获取列表
    getPage: query => {
        return axios({
            url: '/comment/page',
            method: 'get',
            params: query
        });
    },
    // 增加
    addData: query => {
        return axios({
            url: '/comment/add',
            method: 'post',
            data: query
        });
    },
    // 详情
    detailData: id => {
        return axios({
            url: '/comment/info/' + id,
            method: 'get'
        });
    },
    // 修改
    updateData: query => {
        return axios({
            url: '/comment/update',
            method: 'post',
            data: query
        });
    },
    // 删除
    delData: query => {
        return axios({
            url: '/comment/delete',
            method: 'post',
            data: query
        });
    }
};
